home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
lisp
/
kcl
/
kcl.lha
/
h
/
eval.h
< prev
next >
Wrap
C/C++ Source or Header
|
1987-06-04
|
3KB
|
111 lines
/*
(c) Copyright Taiichi Yuasa and Masami Hagiya, 1984. All rights reserved.
Copying of this file is authorized to users who have executed the true and
proper "License Agreement for Kyoto Common LISP" with SIGLISP.
*/
/*
eval.h
*/
/* C control stack */
#define CSSIZE 20000
#define CSGETA 4000
int *cs_org;
int *cs_limit;
#ifdef AV
#define cs_check(something) \
if ((int *)(&something) < cs_limit) \
cs_overflow()
#endif
#ifdef MV
#endif
/* bind template */
struct bind_temp {
object bt_var;
object bt_spp;
object bt_init;
object bt_aux;
};
#define check_symbol(x) \
if (type_of(x) != t_symbol) \
not_a_symbol(x)
#define check_var(x) \
if (type_of(x) != t_symbol || \
(enum stype)(x)->s.s_stype == stp_constant) \
not_a_variable(x)
#define eval_assign(to, form) \
{ \
object *old_top = vs_top; \
\
eval(form); \
to = vs_base[0]; \
vs_top = old_top; \
}
#define MMcall(x) \
ihs_check; \
ihs_push(x); \
(*(x)->cf.cf_self)(); \
ihs_pop()
#define MMccall(x, env_top) \
ihs_check; \
ihs_push(x); \
(*(x)->cc.cc_self)(env_top); \
ihs_pop()
#define MMcons(a,d) make_cons((a),(d))
#define MMcar(x) (x)->c.c_car
#define MMcdr(x) (x)->c.c_cdr
#define MMcaar(x) (x)->c.c_car->c.c_car
#define MMcadr(x) (x)->c.c_cdr->c.c_car
#define MMcdar(x) (x)->c.c_car->c.c_cdr
#define MMcddr(x) (x)->c.c_cdr->c.c_cdr
#define MMcaaar(x) (x)->c.c_car->c.c_car->c.c_car
#define MMcaadr(x) (x)->c.c_cdr->c.c_car->c.c_car
#define MMcadar(x) (x)->c.c_car->c.c_cdr->c.c_car
#define MMcaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car
#define MMcdaar(x) (x)->c.c_car->c.c_car->c.c_cdr
#define MMcdadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr
#define MMcddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr
#define MMcdddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr
#define MMcaaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_car
#define MMcaaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_car
#define MMcaadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_car
#define MMcaaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_car
#define MMcadaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_car
#define MMcadadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_car
#define MMcaddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_car
#define MMcadddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_car
#define MMcdaaar(x) (x)->c.c_car->c.c_car->c.c_car->c.c_cdr
#define MMcdaadr(x) (x)->c.c_cdr->c.c_car->c.c_car->c.c_cdr
#define MMcdadar(x) (x)->c.c_car->c.c_cdr->c.c_car->c.c_cdr
#define MMcdaddr(x) (x)->c.c_cdr->c.c_cdr->c.c_car->c.c_cdr
#define MMcddaar(x) (x)->c.c_car->c.c_car->c.c_cdr->c.c_cdr
#define MMcddadr(x) (x)->c.c_cdr->c.c_car->c.c_cdr->c.c_cdr
#define MMcdddar(x) (x)->c.c_car->c.c_cdr->c.c_cdr->c.c_cdr
#define MMcddddr(x) (x)->c.c_cdr->c.c_cdr->c.c_cdr->c.c_cdr
#define MMnull(x) ((x)==Cnil)